#ifndef _CLLIST_H_
#define _CLLIST_H_
#include <stdio.h>
#include <stdlib.h>
#include "declare.h"

#define ELEMTYPE int
struct CLNode;

typedef struct CLNode * PNode;
typedef struct CLNode * POSITION;

struct CLNode {
    ELEMTYPE info;
    PNode   link;
};

struct clList {
    PNode head;
    PNode rear;
    SIZE_T length;
};

typedef struct clList * CLList;

CLList createCLList(void);
int insertPostCLList(CLList list, POSITION p, ELEMTYPE x);
int insertPreCLList(CLList list, POSITION p, ELEMTYPE x);
int deleteElemCLList(CLList list, ELEMTYPE x);
int deleteVertexCLList(CLList list, POSITION p);
POSITION locateVertexCLList(CLList list, ELEMTYPE x);
void printCLList(CLList list);
void destroyCLList(CLList *list);
int appendElemCLList(CLList list, ELEMTYPE x);
int lengthCLList(CLList list);
#endif
